<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head>
<title>CorClass Sample</title>
<link rel="stylesheet" type="text/css" href="../../../docs/rotor.css">
</head>

<body>		


<h1> CorClass Sample</h1>


<h2>Sample Overview</h2>


<p>This sample tool will search assemblies for class names and return summary 
information about a class if it is found.&nbsp; It extensively uses the 
<b>System.Reflection</b> functionality.</p>


<p>By default, the sample only searches the mscorlib assembly.&nbsp; You must 
specify the <b>-m</b> option to explicitly load other assemblies to be searched.</p>


<p>The following table shows the command-line options used by the sample.</p>


<table border="1" width="90%" >
  <tr>
    <th width="30%">Option<th width="70%">Description</tr>
  <tr>
    <td width="30%"><b>-a</b> <i>level</i></td>
    <td width="70%">Specifies abbreviation level, where <i>level</i> is short,&nbsp;medium, or long.</td>
  </tr>
  <tr>
    <td width="30%"><b>-w</b></td>
    <td width="70%"><font SIZE="2">Generates output in HTML format.</font></td>
  </tr>
  <tr>
    <td width="30%"><b>-f</b></td>
    <td width="70%">Shows fully qualified names in output.</td>
  </tr>
  <tr>
    <td width="30%"><b>-m</b> <i>module</i></td>
    <td width="70%">Loads and searches the <i>module</i> assembly.</td>
  </tr>
  <tr>
    <td width="30%"><b>-noinherit</b></td>
    <td width="70%"><font SIZE="2">Prevents the display of inherited methods and fields.</font></td>
  </tr>
  <tr>
    <td width="30%"><b>-o</b></td>
    <td width="70%">Shows only class names within modules (use with the <b>-m</b> 
    option).</td>
  </tr>
  <tr>
    <td width="30%"><b>-q</b></td>
    <td width="70%">Suppresses error output.</td>
  </tr>
  <tr>
    <td width="30%"><b>-v</b></td>
    <td width="70%">Displays only output visible (public and protected) 
    classes, methods, or fields.</td>
  </tr>
  <tr>
    <td width="30%"><b>-p</b></td>
    <td width="70%">Displays only output public classes, methods, or fields.</td>
  </tr>
  <tr>
    <td width="30%"><b>&nbsp;-h</b></td>
    <td width="70%"><font SIZE="2">Shows usage help.</font></td>
  </tr>
</table>

<h2>Sample Source and Build Output Locations</h2>


<p>The sample source is found in sscli20\samples\utilities\corclass.&nbsp; </p>


<p>The source files are:</p>


<ul class="none">
  <li><a href="basegenerator.cs">basegenerator.cs</a></li>
  <li>
  <a href="consolegenerator.cs">consolegenerator.cs</a></li>
  <li>
  <a href="corcls.cs">corcls.cs</a></li>
  <li>
  <a href="typenames.cs">typenames.cs</a></li>
  <li>
  <a href="webgenerator.cs">webgenerator.cs</a></li>
</ul>


<p>The build output location is %_NTTREE%\samples\utilities\corclass. The output file is an executable assembly named corcls.exe.</p>


<h2>Building the Sample</h2>


<p>All samples are built from the buildall script.&nbsp;  </p>


<p>You can also build all the 
samples by switching to the root of the sample directory, sscli20\samples, and typing 
<code>build -c</code>.</p>


<p>You can build this specific sample  by switching to the sample directory and typing 
<code>build -c</code>.</p>


<h2>Running the Sample</h2>


<p>These steps require that the Shared Source CLI (SSCLI) be already built and 
functional.</p>


<ol>
  <li>Run the env.bat. </li>
  <li>Switch to the %_NTTREE%\samples\utilities\corclass directory.</li>
  <li>Type the following command:<blockquote>


<p>clix corcls <i>classname</i></p>


  </blockquote>


  </li>
</ol>
<blockquote>


<p>where <i>classname</i> is the name of the type for which you are searching.</p>


</blockquote>


<hr>


<p><i>Copyright (c) 2006 Microsoft Corporation. All rights reserved.</i></p>
</body> 
</html>